﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using CuoiHoi.Entities;
using CuoiHoi.Business;
using System.Configuration;

namespace CuoiHoi
{
    public partial class Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            int IdDanhMuc =int.Parse(ConfigurationManager.AppSettings["IdDanhMuc"].ToString());
            LoadDanhMuc(IdDanhMuc);
        }

        public void LoadDanhMuc(int idDanhMuc)
        {
            UserControls.DanhMuc.idDanhMuc = idDanhMuc;
            PlaceHolder1.Controls.Add(LoadControl("~/UserControls/DanhMuc.ascx"));
        }
        public void LoadSEO(int idDanhMuc)
        {
            ETheLoai theloai = BTheLoai.SelectByID(idDanhMuc);
            if (theloai.Title != null)
            {
                Page.Title = theloai.Title;
                Page.MetaDescription = theloai.Description;
                Page.MetaKeywords = theloai.Keyword;
            }        
        }
    }
}